package com.baidu.model;



import java.io.Serializable;

import com.baidu.basic.DateUtils;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

/**
 * 回帖记录
 * @author libs
 * 2015-12-23 11:44
 */
public class ReplyRec extends Model<ReplyRec> implements Serializable{
	
	private static final long serialVersionUID = 282908528936842633L;
	public static final ReplyRec dao = new ReplyRec();
	
	/**
	 * 清空今天之前的回帖记录
	 */
	public void clearRec() {
		StringBuffer sql = new StringBuffer();
		sql.append("delete from reply_rec where DATE_FORMAT(replyTime,'%Y-%m-%d') < DATE_FORMAT(?,'%Y-%m-%d')");
		Db.update(sql.toString(), DateUtils.realTime("Asia/Shanghai"));
	}
	
}
